package org.micro.frame.mybatis.datasource;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

@Configuration
public class MyBatisMapperScannerConfig implements EnvironmentAware {

    @Override
    public void setEnvironment(Environment environment) {

    }

    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer() {
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setSqlSessionTemplateBeanName("test1SqlSessionTemplate");
        mapperScannerConfigurer.setBasePackage("org.micro.frame.mybatis.mapper.test1");
        return mapperScannerConfigurer;
    }

}